import request from '@/utils/request_zc'

export function getSaleReturnList ({
  returnNo,
  deliveryNo,
  contractNo,
  customerId,
  returnStartDate,
  returnEndDate,
  inboundStatus,
  page,
  limit, }) {
  return request({
    url: '/scm/sales/return/list',
    method: 'get',
    params: {
      returnNo,
      deliveryNo,
      contractNo,
      customerId,
      returnStartDate,
      returnEndDate,
      inboundStatus,
      page,
      limit
    }
  })
}

export function editSaleReturn ({
  deliveryId,
  detailList,
  id,
  remark,
  returnDate,
  returnReason
}) {
  return request({
    url: '/scm/sales/return/edit',
    method: 'post',
    data: {
      deliveryId,
      detailList,
      id,
      remark,
      returnDate,
      returnReason
    }
  })
}

export function addSaleReturn ({
  deliveryId,
  detailList,
  remark,
  returnDate,
  returnReason
}) {
  return request({
    url: '/scm/sales/return/add',
    method: 'post',
    data: {
      deliveryId,
      detailList,
      remark,
      returnDate,
      returnReason
    }
  })
}


export function getSaleReturnDetailList ({ id }) {
  return request({
    url: `/scm/sales/return/detail/${id}`,
    method: 'get',
  })
}

export function delSaleReturn ({ ids }) {
  return request({
    url: '/scm/sales/return/del',
    method: 'post',
    data: {
      ids
    }
  })
}
